package cn.cloud.butler.webapi.repository;

import cn.cloud.butler.webapi.domain.auth.ApiUserEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface ApiUserRepository extends JpaRepository<ApiUserEntity,Long> {

    Optional<ApiUserEntity> findById(Long id);

    Optional<ApiUserEntity> findByEmail(String email);

    Optional<ApiUserEntity> findByUserNameOrEmail(String username, String email);

    List<ApiUserEntity> findByIdIn(List<Long> userIds);

    Optional<ApiUserEntity> findByUserName(String username);

    Boolean existsByUserName(String username);

    Boolean existsByEmail(String email);
}
